<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>Galleries</title>
  <%= stylesheet_link_tag 'gallery' %>
</head>
<body>

<div class="main-div">

<% @images.each do |image| %>
	
	<% if image == @images[0] %>
	
		<a href="galleries/show/<%= image['id'] %>">
			<% if image['size'][0] > image['size'][1] %>
	  			<div name="image-div" class="main-image-div main-image-landscape" style="background-image: url(images/galleries/<%= image['path'] %>)"></div>	
			<% else %>
				<div name="image-div" class="main-image-div main-image-portrait" style="background-image: url(images/galleries/<%= image['path'] %>)"></div>	
			<% end %>
		</a>
		
	<% else %>

		<a href="galleries/show/<%= image['id'] %>">
			<% if image['size'][0] > image['size'][1] %>
	  			<div name="image-div" class="image-div image-landscape" style="background-image: url(images/galleries/<%= image['path'] %>)"></div>	
			<% else %>
				<div name="image-div" class="image-div image-portrait" style="background-image: url(images/galleries/<%= image['path'] %>)"></div>	
			<% end %>
		</a>
	<% end %>
<% end %>

</div>
</body>
</html>